﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using KTX.Public;

namespace KTX.Data
{
   public class NganhData
    {
        ClsKetNoi cls = new ClsKetNoi();
        public DataTable LoadNganh()
        {
            return cls.LayDuLieu("select * from nganh");
        }
        public DataTable TimtheoMaNganh(NganhPublic p)
        {
            int NParameter = 1;
            string[] name = new string[NParameter];
            object[] value = new object[NParameter];
            name[0] = "@ma_nganh";
            value[0] = p.NganhMa;
            return cls.LayDuLieu("select * from nganh where ma_nganh = @ma_nganh", name, value, NParameter);
        }

    }
}
